package com.desire.controller.purchase;

import com.desire.bean.common.PageBean;
import com.desire.bean.common.ResultBean;
import com.desire.bean.purchase.Inquiry;
import com.desire.controller.common.BaseController;
import com.desire.service.purchase.InquiryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author LittleDesire
 * @description
 * @date 2022-05-23 周一 17:58
 * @since 17
 */
@RestController
@Api(tags = "询价管理")
@RequestMapping("/api/inquiry")
public class InquiryController extends BaseController {
    @Autowired
    InquiryService inquiryService;

    //@PostMapping("/query")
    //@ApiOperation(value = "查询供应商", notes = "返回数据分页信息")
    public ResultBean query(@RequestBody Map<String, Object> map) {
        PageBean query = inquiryService.query(map);
        return success(query);
    }

    @PostMapping("/save")
    @ApiOperation(value = "保存询价单", notes = "对询价单进行保存")
    public ResultBean save(@RequestBody Inquiry inquiry) {
        int save = inquiryService.save(inquiry);
        return saveResult(save);
    }

}

